#!/bin/sh

# Make directory for nginx and
# change permissions
# then start nginx with www-data.
mkdir -p /var/lib/nginx && \
chown -R www-data:www-data /var/lib/nginx && \
mkdir -p /var/log/nginx && \
chown -R www-data:www-data /var/log/nginx && \
mkdir -p /run/nginx && \
chown -R www-data:www-data /run/nginx && \
su-exec www-data:www-data nginx

# Chown owner.
chown -R www-data:www-data /data

# Start php fpm.
mkdir -p /var/log/php82 && \
chown -R www-data:www-data /var/log/php82

su-exec www-data:www-data php-fpm82
